﻿//调用改文件时候不要加 defer='defer'

  function LoadVisit() {
    var hm = document.createElement("script");
    hm.src = "http://hm.baidu.com/h.js?decc3412b5ea3f93c481f2b9312e8fc5";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
}
if (window.attachEvent)//IE:如果浏览器中存在window.attachEvent函数则使用window.attachEvent函数,判断是否是IE还可以使用:if (document.all){//..}
    window.attachEvent("onload", function () { LoadVisit(); });
else  //FireFox
    window.addEventListener("load", function () { LoadVisit(); }, true); 

